package com.thon.entity.util;

import org.hibernate.cfg.ImprovedNamingStrategy;

/**
 * @file PrefixImprovedNamingStrategy.java 
 * @author manpiaoyi
 * @email manpiaoyi@126.com
 * @date 2014-10-14
 * @description 表与实体关系
 */
public class PrefixImprovedNamingStrategy extends ImprovedNamingStrategy {
	private static final long serialVersionUID = 3097086534970692039L;
	
	private String tablePrefix = "pt_";
	private String columnPrefix = "";
	
	public PrefixImprovedNamingStrategy() {
	}

	@Override
	public String tableName(String tableName) {
		return tablePrefix + super.tableName(tableName);
	}
	
	@Override
	public String columnName(String columnName) {
		return columnPrefix + super.columnName(columnName);
	}
	
	@Override
	public String propertyToColumnName(String propertyName) {
		return columnPrefix + super.propertyToColumnName(propertyName);
	}
	
}
